<!doctype html>
<html>
               
	<head>
		<meta charset=UTF-8 />
         		<title> Basic HTML Example </title>
                                      
	</head>

	<body>
		<h2> Example web post page... </p2>
		<br/> <br/>
                                      <p> Enter post and user name  below....</p>

                                      <textarea rows="4" cols="50" id="txtarea">
		</textarea>
			
		<br/>

		<label> Posted by : </label>
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="text" id="txtbx">
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<button onClick=post()> Submit </button>

		
	<div id = "disp_data">
            		<label id="time_Of_Post" > </label> <label id="posted_By" > </label>  <label id="post_Message"> </label> <br/>

	</div>

	<script>

		function postData()
		{
			var mytxt = document.getElementById('txtarea').value;
			var myUn = document.getElementById('txtbx').value;
			var myDt = Date();

			document.getElementById('time_Of_Post').innerHTML=myDt;
			document.getElementById('post_Message').innerHTML=mytxt;
			document.getElementById('posted_By').innerHTML=myUn;


		}

		var i=0;
                                      function post()
		{
			
			
			if(document.getElementById('txtarea').value!='' && document.getElementById('txtbx').value!='')
			{
				i++;
				var  data= "On" + Date() + " ; " + 
					document.getElementById('txtbx').value + " Wrote : "+
					document.getElementById('txtarea').value;

				var node= document.createElement('div');
				
				node.innerHTML = i + "." + data;

				document.getElementById('disp_data').appendChild(node);				
			}

			else
				alert("Please make sure post and user name should be mentioned properly");
				
		}
	
	</script>

	</body>
</html>




